<template>
  <div class="child-page">
    <div> 儿子组件2 拥有书：{{ books }}</div>
    <button @click="editHouse($parent)">修改父组件house</button>
  </div>
</template>
<script setup lang="ts" name="refAndParentChild2">
import { ref } from 'vue';

const books = ref(5);
defineExpose({books})


function editHouse(parent:any){
  console.log(parent);
  
  parent.editHouse(1);
}

</script>
<style  scoped>
.child-page{
  padding: 20px 50px;
  background: green;
  color: #fff;
  margin-top: 10px;
}
</style>
